package com.zh.note.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author: zhanghuan
 * @date: 2023/5/8 22:06
 * @description: create it
 */
@Component
public class DemoListener2 implements ApplicationListener<DemoEvent> {

    @Override
    public void onApplicationEvent(DemoEvent event) {
        String message = event.getMessage();
        System.out.println("监听到事件，开始执行任务：" + message);
    }
}
